package com.zhs.study.rocketMq.controller;

import com.zhs.study.common.R;
import com.zhs.study.rocketMq.springboot.MQProducerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *
 * @Author zhenghuisheng
 * @Date：2025/4/21 21:28
 */
@RestController
@RequestMapping("/mq")
@Slf4j
public class MqController {

    @Resource
    private MQProducerService mqProducerService;

    @GetMapping("/sendMessage")
    public R<String> sendMessage(String message) {
        mqProducerService.sendMessage(message);
        return R.ok(message);
    }
}
